package com.kelvin.paopao.module.person.editmore;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.EditText;

import com.kelvin.paopao.R;
import com.kelvin.paopao.module.base.BaseActivity;
import com.kelvin.paopao.widgets.CustomToolbar;

import butterknife.BindView;

/**
 * 用户详情填写的activity
 * Created by MCK on 2017/5/11.
 */

public class PersonDetailEditMoreActivity extends BaseActivity {
    @BindView(R.id.custom_toolbar)
    CustomToolbar customToolbar;
    @BindView(R.id.et)
    EditText et;

    private String type;

    public static final String TYPE_EDIT_NICKNAME = "1001";
    public static final String TYPE_EDIT_PROFESSIONAL = "1002";
    public static final String TYPE_EDIT_HEIGHT= "1003";

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_person_detail_edit_more;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initViews() {
        type = getIntent().getAction();
        if (type == TYPE_EDIT_NICKNAME) {
            et.setHint("请填写你的昵称");
        } else if (type == TYPE_EDIT_PROFESSIONAL) {
            et.setHint("请填写你的职业");
        }else{
            et.setHint("请填写你的身高");
        }
        customToolbar.showBackIcon(this);
        customToolbar.inflateMenu(R.menu.menu_person_detail_confirm);
        customToolbar.setMenuOnClick(new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                Intent intent = new Intent();
                intent.putExtra("data", et.getText().toString().trim());
                setResult(Activity.RESULT_OK, intent);
                finish();
                return true;
            }
        });
    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }
}
